package com.wangyk.thymeleafproject.controller;

import com.wangyk.rabbitmqcommon.model.console.User;
import com.wangyk.thymeleafproject.console.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

/**
 * 使用Feign的方式调用其它的服务
 */
@Controller
@RequestMapping("/feign")
public class FeignController
{
    @Autowired
    private UserService userService;

    @RequestMapping("/get_user_info.do")
    @ResponseBody
    public User getUserInfo()
    {
        User user=userService.getUserByUserId();
        return user;
    }
}
